package Demo1;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Test2 {
    public static void main(String[] args) throws IOException {
        //获取系统类加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        //利用加载器去加载一个指定文件
        //参数：文件的路径
        //返回值：字节流
        InputStream is = systemClassLoader.getResourceAsStream("Day17:\\src\\prop.properties");

        Properties prop = new Properties();
         prop.load(is);

        System.out.println(prop);

        is.close();
    }
}
